import React, { useRef } from 'react'
import { HashRouter as Router, Route, Switch, Redirect } from "react-router-dom";
import { Header } from '@components/Header/header'
import { LeftMenu } from '@components/LeftMenu/leftMenu'
import * as actionCreators from '@store/actionCreators'
import { connect } from 'react-redux'
import { ControlUtil } from '@components/ControlUtil/controlUtil'
import Index from '@pages/Index/index'
import Home from '@pages/Home/home'
import { ComponentsPageWrapper } from '@components/ComponentsPageWrapper/componentsPageWrapper';



export const Content = connect(
    state => ({
    }),
    dispatch => ({
    }))(
		props => {

			return <Router>
						<Header/>
						<Switch>
							<Route exact path="/ararin-ui/home" component={Home} />
							<Route path="/ararin-ui" render={() => {
								return	<>
											<div className="content_wrapper">
												<LeftMenu className="left_menu"/>
												<div className="content">
													<ControlUtil />
													<Route exact path="/ararin-ui/index" component={Index}/>
													<Route path="/ararin-ui/view" render={() => {
														return 	<ComponentsPageWrapper 
																	currentRouter={window.location.href.split('#')[1]}
																/>
													}} />
												</div>
											</div>
										</> 
							}} />
							<Route path="/ararin-ui/test" component={Index}/>
							<Redirect from="*" to="/ararin-ui/home" />
						</Switch>
					</Router>
		}
	)

export default Content